package com.sgb.kjwl.view.ui.adapter.self.publish;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.sgb.kjwl.R;
import com.sgb.link.entity.PublicTypeEntity;
import com.swgk.core.BR;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class MachinePublishTypeRAdapter extends BaseRecycleAdapter<PublicTypeEntity> {
    private ImageView imageView;

    public MachinePublishTypeRAdapter(Context context, List<PublicTypeEntity> datas) {
        super(context, R.layout.item_machine_publish_type_r, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final PublicTypeEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        imageView = holder.itemView.findViewById(R.id.photo_img);
        Glide.with(context).load(entity.getIcon()).into(imageView);
    }
}